<?php
namespace Model;
use Kuyuan\WqCore\Model\Model;

/**
 * 发红包权限
 * Class RedAccessModel
 * @package Model
 */
class RedAccessModel extends Model
{
    protected $_fields = array(
        "id",
        "uniacid",
        "uid",
        "status",
        "time"
    );

    //--------设置--------------

    /**
     * 设置申请时间
     */
    public function setTimeAttr()
    {
        return TIMESTAMP;
    }

    //-------获取--------
    public function getUserAttr($_value,$_data)
    {
        if(isset($_data["uid"])) {
            return W7McMembersModel::where("uid",$_data["uid"])
                ->field(array("nickname","avatar"))
                ->cache(!KUYUAN_DEBUG)
                ->find();
        }
    }
}